package com.ccl.keyassistant.entity;


/*
 *项目名     keyassistant
 *包名       com.ccl.keyassistant.entity
 *文件名     MBluetoothDevice
 *创建者     ccl
 *创建时间   2019-03-12 20:51
 *注解       BluetoothDevice封装类,为了去重
 */

import android.bluetooth.BluetoothDevice;

import java.util.Objects;

public class MBluetoothDevice  {
    private BluetoothDevice bluetoothDevice;


    public MBluetoothDevice(BluetoothDevice bluetoothDevice) {
        this.bluetoothDevice = bluetoothDevice;
    }

    public BluetoothDevice getBluetoothDevice() {
        return bluetoothDevice;
    }

    public void setBluetoothDevice(BluetoothDevice bluetoothDevice) {
        this.bluetoothDevice = bluetoothDevice;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;
        MBluetoothDevice that = (MBluetoothDevice) o;
        return Objects.equals(bluetoothDevice.getAddress(), that.bluetoothDevice.getAddress());
    }

    @Override
    public int hashCode() {
        return Objects.hash(bluetoothDevice.getAddress());
    }
}
